<!DOCTYPE html>
<html lang="zh">
<head>
	<th:block th:include="include :: header('动态对象表单')" />
</head>

<script>

$(document).ready(function(){

var counter = 1;
    $("#addnew").click(function(event){
    event.preventDefault();
    counter++;
    var newRow = jQuery('<tr><td><select name="doc.name"><option  value="10" name="10">10th Mark-sheet</option><option value="" name="12">12th Mark-sheet</option>'+
'<option value="MSA" name="MSA">UG Mark-sheet(All Semesters)</option>'+
'<option value="UGM" name="UGM">UG Consolidated Mark-sheet</option>'+
'<option value="UGD" name="UGD">UG Degree/Provisional Degree</option>'+
'<option value="MC" name="MC">Migration Certificate</option>'+
'<option value="TC" name="TC">Transfer Certificate</option>'+
'</select></td>'+
'<td><select name="doc.original"><option value="yes">Yes</option><option value="due">Due</option><option value="NA">N/A</option></select></td><td>'+
'<select name="doc.photocopy"><option value="yes">Yes</option><option value="due">Due</option><option value="na">N/A</option></select></td><td>'+
'<select name="doc.printout"><option value="yes">Yes</option><option value="due">Due</option><option value="na">N/A</option></select></td><td><input type="date"></td><td><input type="date"></td></tr>');
    jQuery('table.table-hover').append(newRow);
});
});


</script>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        
    <center><h1>Document Submission Record</h1></center>
    <br/>



    <!-- College Id No.</td><td> <input type="text" class="form-group">&nbsp;
    Ref. Id</td><td> <input type="text" class="form-group">&nbsp;
    Name</td> <input type="text" class="form-group">
    <br/><br/>
     -->

    <form th:action="@{/save}" method="post" th:object="${documents}">

    <center><h3><strong>Documents</strong></h3></center><br/>



    <TABLE class="table table-hover" >

        <tr>
            <th >Document Name</th>
            <th colspan="3">Document Type</th>
            <th>Received Date</th>
            <th>Due Date</th>
        </tr>

        <tr>
                <td></td>
                <td>Original</td>
                <td>Photocopy</td>
                <td>Printout</td>
                <td></td>
                <td></td>
        </tr>



        <tr th:each="doc :${documents.document}" th:field="*{document}">

                <td>
                <select name="doc.name">
                    <option value="10">10th Mark-sheet</option>
                    <option value="12">12th Mark-sheet</option>
                    <option value="MSA">UG Mark-sheet (All Semesters)</option>
                    <option value="UGM">UG Consolidated Mark-sheet</option>
                    <option value="UGD">UG Degree/Provisional Degree</option>
                    <option value="MC">Migration Certificate</option>
                    <option value="TC">Transfer Certificate</option>
                    </select>
                </td>
                <td>

                <select name="doc.original" th:field="*{document.orignal}">
                    <option value="yes">Yes</option>
                    <option value="due">Due</option>
                    <option value="NA">N/A</option>
                </select>
                </td>
                <td>


                <select name="doc.photocopy" th:field="*{document.photocopy}">
                    <option value="yes">Yes</option>
                    <option value="due">Due</option>
                    <option value="NA">N/A</option>
                </select>
                </td>

                <td>


                <select name="doc.printout"  th:field="*{document.printout}">
                    <option value="yes">Yes</option>
                    <option value="due">Due</option>
                    <option value="NA">N/A</option>
                </select>
                </td>
                <td>
                <input type="date">
                </td>
                <td>
                <input type="date">
                </td>
            </tr>
    </TABLE>

<button type="button" class="btn btn-primary" id="addnew">Add Row</button><br/><br/>
<br/>
        <button type="submit" class="btn btn-primary">Save</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</form>
    </div>
    <th:block th:include="include :: footer" />
</body>
</html>
